/*
 * @Author: 专送Pro
 * @Date: 2019-08-23 13:17:18
 * @LastEditors  : wuzhen
 * @LastEditTime : 2019-12-31 13:44:15
 * @Description: 新增表单配置文件
 */
export default {
  data() {
    return {};
  },
  computed: {
    formProps() {
      return [
        {
          forms: [
            {
              label: "角色名称",
              type: "text",
              key: "rolename",
              span: 22,
              placeholder: "请输入角色名称",
              rules: {
                required: true,
                trigger: "blur",
                validator: (rule, value, callback) => {
                  if (!/^[\u4E00-\u9FA5]{1,10}$/.test(value)) {
                    return callback(new Error("只支持1-10个汉字！"));
                  } else if (!value) {
                    return callback(new Error("角色名称不能为空！"));
                  } else {
                    callback();
                  }
                }
              }
            },
            {
              label: "备注说明",
              type: "textarea",
              key: "description",
              span: 22,
              placeholder: "请输入备注说明"
            }
          ]
        }
      ];
    }
  }
};
